package reflection;

public class Test02 {
    static {
        System.out.println("main类被加载");
    }
    public static void main(String []args) throws ClassNotFoundException {
        //Son son=new Son();
        //Class.forName("reflection.Son");

        System.out.println(Son.m);//子类并不会加载

        //Son []son=new Son[5];
    }
}

class Father{
    static {
        System.out.println("父类被加载");
    }
    static int b=2;
}

class Son extends Father{
    static {
        System.out.println("子类被加载");
    }
    static int m=100;
    static final int M=1;
}

